/*
 * Copyright 2008-2009 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ssn.servicearea.service.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import ssn.servicearea.vo.ServiceAreaVO;

import egovframework.rte.psl.dataaccess.EgovAbstractDAO;


/**  
 * @Class Name : 
 * @Description : 
 * @Modification Information  
 * @
 * @  수정일      수정자              수정내용
 * @ ---------   ---------   -------------------------------
 * 
 * @since 2013. 09.30
 * @version 1.0
 * @see
 */
@SuppressWarnings("rawtypes")
@Repository("serviceareaDAO")
public class ServiceAreaDAO extends EgovAbstractDAO {

	public String selectServiceAreaInfoPk() throws Exception{
		return (String)getSqlMapClientTemplate().queryForObject("selectServiceAreaInfoPk");
	}
	public String selectServiceAreaMaxAreaKey() throws Exception{
		return (String)getSqlMapClientTemplate().queryForObject("selectServiceAreaMaxAreaKey");
	}
	public String selectServiceAreaManagerInfoPk(String parentKey) throws Exception{
		return (String)selectByPk("selectServiceAreaManagerInfoPk", parentKey);
	}
	public String selectServiceAdminPK(String ssa_area_key) throws Exception{
		return (String)selectByPk("selectServiceAdminPK", ssa_area_key);
	}
	public String selectServiceAreaPw(String ssa_area_key) throws Exception{
		return (String)selectByPk("selectServiceAreaPw", ssa_area_key);
	}
	public void insertServiceAreaInfo(ServiceAreaVO vo) throws Exception{
		insert("insertServiceAreaInfo", vo);
	}
	public void insertServiceAreaMeta(ServiceAreaVO vo) throws Exception{
		insert("insertServiceAreaMeta", vo);
	}
	public void insertServiceAreaManagerInfo(ServiceAreaVO vo) throws Exception{
		insert("insertServiceAreaManagerInfo", vo);
	}
	public void updateServiceAreaInfo(ServiceAreaVO vo) throws Exception{
		update("updateServiceAreaInfo", vo);
	}
	public void updateServiceAreaMeta(ServiceAreaVO vo) throws Exception{
		update("updateServiceAreaMeta", vo);
	}
	public List selectServiceAreaList(ServiceAreaVO vo) throws Exception{
		return list("selectServiceAreaList", vo);
	}
	public List selectServiceAreaList() throws Exception{
		return getSqlMapClientTemplate().queryForList("selectServiceAreaListAll");
	}
	public int selectServiceAreaListCnt(ServiceAreaVO vo) throws Exception{
		return Integer.parseInt(selectByPk("selectServiceAreaListCnt", vo).toString());
	}
	public ServiceAreaVO selectServiceAreaInfo(ServiceAreaVO vo) throws Exception{
		return (ServiceAreaVO)selectByPk("selectServiceAreaInfo", vo);
	}
	public List selectServiceAreaManagerInfoList(String parentKey) throws Exception{
		return list("selectServiceAreaManagerInfo", parentKey);
	}
	public void deleteServiceAreaManager(String parentKey) throws Exception{
		delete("deleteServiceAreaManager", parentKey);
	}
	
	/**
	 * 관리자
	 */
	public void insertServiceAreaAdminInfo(ServiceAreaVO vo) throws Exception{
		insert("insertServiceAreaAdminInfo", vo);
	}
	public ServiceAreaVO selectServiceAreaAdminInfo(ServiceAreaVO vo) throws Exception{
		return (ServiceAreaVO)selectByPk("selectServiceAreaAdminInfo", vo);
	}
	public List selectServiceAreaAdminList(ServiceAreaVO vo) throws Exception{
		return list("selectServiceAreaAdminList", vo);
	}
	public int selectServiceAreaAdminListCnt(ServiceAreaVO vo) throws Exception{
		return Integer.parseInt(selectByPk("selectServiceAreaAdminListCnt", vo).toString());
	}
}
